package com.xinqi.modules.prepare.folder.convert;

import com.xinqi.common.mapstruct.CommonConvertConfig;
import com.xinqi.modules.prepare.folder.domain.PrepareFileFolderEntity;
import com.xinqi.modules.prepare.folder.dto.req.PrepareFileFolderCreateDTO;
import com.xinqi.modules.prepare.folder.dto.req.PrepareFileFolderUpdateDTO;
import com.xinqi.modules.prepare.folder.dto.rsp.PrepareFileFolderResultDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.MappingTarget;

/**
 * 备课区文件夹转换
 *
 * @author: system
 * @date: 2023/03/19
 */
@Mapper(config = CommonConvertConfig.class)
public abstract class PrepareFileFolderConvert {
    public abstract PrepareFileFolderEntity create(PrepareFileFolderCreateDTO s);

    public abstract PrepareFileFolderEntity update(PrepareFileFolderUpdateDTO s, @MappingTarget PrepareFileFolderEntity t);

    public abstract PrepareFileFolderEntity update(PrepareFileFolderUpdateDTO s);

    public abstract PrepareFileFolderResultDTO copy(PrepareFileFolderEntity s);

    @Mapping(target = "id", ignore = true)
    @Mapping(target = "prepareId", ignore = true)
    @Mapping(target = "createBy", ignore = true)
    @Mapping(target = "createTime", ignore = true)
    @Mapping(target = "updateBy", ignore = true)
    @Mapping(target = "updateTime", ignore = true)
    @Mapping(target = "deleteTime", ignore = true)
    @Mapping(target = "isDelete", ignore = true)
    public abstract PrepareFileFolderEntity copy(PrepareFileFolderEntity s, @MappingTarget PrepareFileFolderEntity t);
}
